/**
 * @apiDefine cart 购物车、退货模式
 * @apiHeader {String} token 用户登录获取的token
 */


/**
 * @api {POST} /cart/goods_list 购物、退货商品列表
 * @apiSampleRequest /cart/goods_list
 * @apiGroup cart
 * @apiUse cart
 * @apiParam {String} bill_num 购物车单号
 * @apiParam {Number} [retained_flag=0] 取单标记（retained_flag=1会更新挂单状态），恢复挂单列表需要设置该参数
 * @apiParam {Number} [status=0] 状态，获取挂单购物车status=-1
 * @apiParam {Number} [cart_mode=0] 购物车类型，0购物模式，1退货模式
 * @apiSuccess {Object} /data 数据
 * @apiSuccessExample {json} 成功响应：
 * HTTP/1.1 200 OK
 * {
 *     "errcode": 0,
 *     "data": [
 *         {
 *             "id": 16,
 *             "shop_id": 1,
 *             "cashier_id": 0,
 *             "barcode": "6901668053806",
 *             "goods_id": 151,
 *             "member_id": 0,
 *             "bill_num": "202109241719",
 *             "goods_name": "骆驼一条",
 *             "selling_price": "10.00",
 *             "unit_price": "10.00",
 *             "amount": 2,
 *             "subtotal": "20.00",
 *             "err": null,
 *             "status": -1,
 *             "created": 1632705443,
 *             "updated": 1632705443,
 *             "deleted": 0
 *         }
 *     ],
 *     "total": 1,
 *     "page": 1,
 *     "size": 15,
 *     "total_sum": "20.00",
 *     "member_id": 0 // 会员ID
 * }
 */


/**
 * @api {POST} /cart/add_goods 购物车添加商品
 * @apiSampleRequest /cart/add_goods
 * @apiGroup cart
 * @apiUse cart
 * @apiParam {Number} goods_id 商品ID
 * @apiParam {Number} member_id 会员ID
 * @apiParam {String} bill_num 购物车单号
 * @apiParam {String} barcode 条形码
 * @apiParam {Number} [cart_typ=0] 购物车类型，0购物车，1退货，2换货
 * @apiSuccess {Object} /data 数据
 * @apiSuccessExample {json} 成功响应：
 * HTTP/1.1 200 OK
 * {
 *     "errcode": 0,
 *     "data": {
 *         "goods_id": 1662,
 *         "goods_name": "博大谷蔬系列龙须挂面",
 *         "selling_price": 11.0,
 *         "unit_price": 11.0, // 单价
 *         "spec_typ": 0, // 0计数，1称重
 *         "unit": "袋",
 *         "risk_grade": 0, // 1为烟酒
 *         "cart_typ": 0,
 *         "id": 2384, // 购物车ID
 *         "subtotal": "33.00", // 小计
 *         "amount": "4.000",
 *         "is_half": 1 // 是否半价，0否，1或2是
 *     }
 * }
 */


/**
 * @api {POST} /cart/add_goods_by_price 购物车添加无码商品
 * @apiSampleRequest /cart/add_goods_by_price
 * @apiGroup cart
 * @apiUse cart
 * @apiParam {String} price 价格
 * @apiParam {String} bill_num 购物车单号
 * @apiParam {Number} [cart_typ=0] 购物车类型，0购物车，1退货，2换货
 * @apiSuccess {Object} /data 数据
 * @apiSuccessExample {json} 成功响应：
 * HTTP/1.1 200 OK
 * {
 *     "errcode": 0,
 *     "data": {
 *         "id": 1291,
 *         "goods_id": 0,
 *         "goods_name": "无码商品",
 *         "selling_price": "123.12",
 *         "unit_price": "123.12",
 *         "subtotal": "-123.12",
 *         "amount": 1,
 *         "risk_grade": 0,
 *         "cart_typ": 1
 *     }
 * }
 */


/**
 * @api {POST} /cart/update_goods 更新购物车
 * @apiSampleRequest /cart/update_goods
 * @apiGroup cart
 * @apiUse cart
 * @apiParam {Number} id 购物车ID
 * @apiParam {Number} [amount] 数量,字段不存在，累加
 * @apiParam {String} selling_price 收银员输入的价格
 * @apiSuccess {Object} /data 数据
 * @apiSuccessExample {json} 成功响应：
 * HTTP/1.1 200 OK
 * {
 *     "errcode": 0
 * }
 */


/**
 * @api {POST} /cart/del_goods 从购物车删除商品
 * @apiSampleRequest /cart/del_goods
 * @apiGroup cart
 * @apiUse cart
 * @apiParam {Number} id 购物车ID
 * @apiSuccess {Object} /data 数据
 * @apiSuccessExample {json} 成功响应：
 * HTTP/1.1 200 OK
 * {
 *     "errcode": 0
 * }
 */


/**
 * @api {POST} /cart/retained 挂单
 * @apiSampleRequest /cart/retained
 * @apiGroup cart
 * @apiUse cart
 * @apiParam {String} bill_num 购物车单号
 * @apiParam {Number} member_id 会员id
 * @apiSuccess {Object} /data 数据
 * @apiSuccessExample {json} 成功响应：
 * HTTP/1.1 200 OK
 * {
 *     "errcode": 0
 * }
 */


/**
 * @api {POST} /cart/retained_list 取单（挂单列表）
 * @apiSampleRequest /cart/retained_list
 * @apiDescription <p>返回挂单列表，通过bill_num，访问“购物车商品列表”接口获取已挂单商品列表</p>
 * @apiGroup cart
 * @apiUse cart
 * @apiSuccess {Object} /data 数据
 * @apiSuccessExample {json} 成功响应：
 * HTTP/1.1 200 OK
 * {
 *     "errcode": 0,
 *     "data": [
 *         {
 *             "bill_num": "202109241720", // 购物车单号
 *             "created": 1632724212
 *         }
 *     ],
 *     "total": 2,
 *     "page": 1,
 *     "size": 15
 * }
 */


/**
 * @api {POST} /cart/del_cart 作废（删除挂单记录）
 * @apiSampleRequest /cart/del_cart
 * @apiGroup cart
 * @apiUse cart
 * @apiParam {String} bill_num 购物车单号
 * @apiSuccess {Object} /data 数据
 * @apiSuccessExample {json} 成功响应：
 * HTTP/1.1 200 OK
 * {
 *     "errcode": 0
 * }
 */
